package com.atguigu.spzx.product.controller;

import com.atguigu.spzx.common.result.Result;
import com.atguigu.spzx.product.service.impl.CategoryServiceImpl;
import com.atguigu.spzx.product.vo.CategoryTreeQueryVo;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * CategoryController
 * </p>
 *
 * @author flyduck
 * @since 2023/11/3
 */
@Api(tags = "分类管理接口")
@RestController
@RequestMapping("/api/product/category")
public class CategoryController {

    @Autowired
    private CategoryServiceImpl categoryService;

    @ApiOperation("获取分类树形数据")
    @GetMapping("/findCategoryTree")
    public Result findCategoryTree(){
        List<CategoryTreeQueryVo> respVoList = categoryService.findCategoryTree();
        return Result.ok(respVoList);
    }
}
